module('money', package.seeall)

if CLIENT then
	local curMoney = 0
end

function FormatMoney(num)
	if num == 0 then return "no doubloons" end
	if num == 1 then return "1 doubloon" end
	
	return num.." doubloons"
end

function CanAfford(ply, price)
	return GetMoney(ply) >= price
end

function GetMoney(ply)
	if CLIENT then
		return curMoney
	else
		return ply._Money or 12
	end
end